/// @tags:
#include <cstdio>
#include <cstring>
#include <functional>
#include <iostream>
#include <numeric>

using std::cin, std::cout, std::endl;

namespace BlueQuantum {

constexpr int maxn = 3e5;

char s[maxn + 2], t[maxn + 2];

bool pre[maxn + 2], suf[maxn + 2];

int main() {
  cin >> (s + 1) >> (t + 1);

  int n = strlen(s + 1), m = strlen(t + 1);
  suf[m + 1] = true;
  for (int x = m; x >= 1; --x) {
    int j = n - (m - x);
    suf[x] = suf[x + 1] && (!(s[j] != '?' && t[x] != '?' && s[j] != t[x]));
  }
  pre[0] = true;
  for (int i = 1; i <= m; ++i) {
    pre[i] = pre[i - 1] && (!(s[i] != '?' && t[i] != '?' && s[i] != t[i]));
  }
  for (int x = 0; x <= m; ++x) {
    cout << ((pre[x] && suf[x + 1]) ? "Yes\n" : "No\n");
  }
  return 0;
}

}  // namespace BlueQuantum

int main() {
#ifndef ONLINE_JUDGE
#ifdef LOCAL
  freopen("/tmp/CodeTmp/testdata.in", "r", stdin);
  freopen("/tmp/CodeTmp/testdata.out", "w", stdout);
#else
  freopen("D - Match or Not.in", "r", stdin);
  freopen("D - Match or Not.out", "w", stdout);
#endif
#endif

  std::ios::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
  return BlueQuantum::main();
}
